(function () {
  let mychart = echarts.init(document.querySelector('.gauge'));
  let option = {
    series: [
      {
        type: 'pie',
        radius: ['130%', '150%'],
        center: ['48%', '80%'],
        startAngle: 180,
        hoverOffset: 0, //hover缩放
        avoidLabelOverlap: false,
        label: {
          show: false,
          position: 'center',
        },
        data: [
          {
            value: 130,
            itemStyle: {
              color: new echarts.graphic.LinearGradient(
                // (x1,y2) 点到点 (x2,y2) 之间进行渐变
                0,
                0,
                0,
                1,
                [
                  { offset: 0, color: '#00fffb' }, // 0 起始颜色
                  { offset: 1, color: '#0061ce' }, // 1 结束颜色
                ]
              ),
            },
          },
          { value: 70, itemStyle: { color: '#12274d' } },
          { value: 200, itemStyle: { color: 'transparent' } },
        ],
      },
    ],
  };
  mychart.setOption(option);
  window.addEventListener('resize', function () {
    mychart.resize();
  });
})();
